package com.kaiyiweitong.tongxing.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.kaiyiweitong.tongxing.R;

/**
 * Created by Administrator on 2017/12/19 0019.
 */

public class ServiceAddressAdapter extends RecyclerView.Adapter {

    private Context mContext;
    private final LayoutInflater mInflater;

    public interface OnClickListener {
        void onClick(int position);
    }

    public ServiceAddressAdapter(Context context) {
        mContext = context;
        mInflater = LayoutInflater.from(context);
    }

    @Override
    public int getItemViewType(int position) {
        if (position == 3) {
            return 1;
        } else {
            return 0;
        }
    }


    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = mInflater.inflate(R.layout.item_service_address, null);
            MyViewHolder myViewHolder = new MyViewHolder(view);
            return myViewHolder;

    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
    }

    @Override
    public int getItemCount() {
        return 3 ;
    }

    private class MyViewHolder extends RecyclerView.ViewHolder {

        public MyViewHolder(View itemView) {
            super(itemView);
        }
    }

    private class AddViewHolder extends RecyclerView.ViewHolder {

        public AddViewHolder(View itemView) {
            super(itemView);
        }
    }
}
